package com.puff.ioc;

import com.puff.framework.utils.ClassUtil;
import com.puff.jdbc.tx.proxy.TXProxy;

/**
 * 直接生成源码
 * @author dongchao
 *
 */
public class SourceProxy implements TXProxy {
	private Class<?> clazz;

	public SourceProxy(Class<?> clazz) {
		JavaSource source = JavaSourceCreate.enhance(clazz);
		this.clazz = JDKCompiler.INSTANCE.compileToClass(source);
	}

	@Override
	public Object getProxy() {
		return ClassUtil.newInstance(clazz);
	}

}
